
cap log using "Loanshark_Describe_Vars.log", replace

******************************************************************
*
** Describe variables used in each Table for ReStats Manuscript **
*
******************************************************************


use loanshark_data_final, clear

 
*******************
***** Table 1 *****
*******************

** Panel A
des gender ethnicity edu workstatus incomemon 

** Panel B 
des debt borrowexp famfrdborrowfreq famfrdfailrepayfreq borrowfreq failrepayfreq drinking drug gambling savepct lavishpct 

*******************
***** Table 2 *****
******************* 

** Panel A
des loan loanasked rate_pct repaytime repayfull repayendD conscription  

** Panel B
des howrepayn1  howrepayn4 howrepayn2 howrepayn3 howrepayn6 howrepayn9 conscription 

des forcen11 forcen1  

des forcen2 forcen3 forcen4  forcen6 forcen7  forcen16 forcen17 forcen18 forcen19

des forcen12 forcen0

des  forcen5 forcen13 forcen14 forcen15  forcen20


** Panel C
desc conditn4  conditn1 conditn2 conditn5  conditn3 

desc collateraln2 collateraln4 collateraln7 collateraln8

desc collateraln3 collateraln6

desc whythisahlongn7 whythisahlongn2 whythisahlongn8 whythisahlongn9 whythisahlongn3  whythisahlongn1  whythisahlongn4
desc reasonn5 reasonn4 reasonn14 reasonn9  reasonn6 reasonn12  reasonn10


* Panel D
sort id sharkid5 enforcement year
egen pair5_year_tag = tag(id sharkid5 year)
lab var pair5_year_tag "Tag for borrower-lender pair and year"
** At borrower-sharkid5 pair level: max number of times transacted with a lender
bys id sharkid5 (year month): gen pair5_num     = _n 
lab var pair5_num "Within a borrower-lender pair: max number of times transacted with a lender"


gen never_contacted = (borrowhist == 0)
lab var never_contacted "Never contracted with this lender"

gen contract_num_year = .
replace contract_num_year = pair5_num if pair5_year_tag
lab var contract_num_year "Times contract with this lender per year"


gen rate_never_contacted =.
replace rate_never_contacted = rate*100 if borrowhist == 0
lab var rate_never_contacted "Nominal rate (if never contracted)"

describe  pair5_year_tag  pair5_num  never_contacted contract_num_year rate_never_contacted

*******************
***** Table 3 *****
******************* 

describe loan loanasked lendrate totalpaid latefee_share default howrepayn3 howrepayn2 lenderrequestwork conscription  noforce remind repayendD id sharkid5 shark5_bor



log close






